package com.easyexcel.demo.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 业务异常
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 24917344854756427L;
    private Integer code;
    private String message;
    private String engMsg;

    public BusinessException() {
        this(ResponseEnum.BUSINESS_EXCEPTION);
    }

    private BusinessException(ResponseEnum responseEnum) {
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMsg();
    }

    public BusinessException(String message) {
        this.message = message;
    }

}
